#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/stat.h>

/*A utility to compare modification times of files*/

int main(int nr, char *argv[])
{
	struct stat buf1, buf2;
	if(nr < 3) {
		printf("Invalid number of arguments\nUsage: %s <file1> <file2>", argv[0]);
		return 3;
	}
	stat(argv[1], &buf1);
	stat(argv[2], &buf2);
	if(buf1.st_mtime > buf2.st_mtime)
		return 1;
	else
		return 2;
}
